#include<bits/stdc++.h>
#define int long long
#define INF (0x3f3f3f3f3f3f3f3f)
using namespace std;


signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n,m,k;
    cin>>n>>m>>k;
    vector<tuple<int,int>> v;
    for (int i=0;i<n;i++)
    {
        int t,c;
        cin>>t>>c;
        v.emplace_back(t,c);
    }
    sort(v.begin(),v.end());
    int l = k;
    int r = get<0>(v[n-1]);
    int mid;
    while (l<=r)
    {
        mid=(l+r)/2;
        int cost=0;
        for (auto i:v)
        {
            if (get<0>(i)>mid)
            {
                cost+=(get<0>(i)-mid)*get<1>(i);
            }
        }
        if (cost>m)
        {
            l=mid+1;
        }
        else
        {
            r=mid-1;
        }
    }
    cout<<l<<endl;
    return 0;
}